from django.urls import path, include
from rest_framework.routers import DefaultRouter
from rest_framework_nested.routers import NestedDefaultRouter
from . import views

router = DefaultRouter()
router.register(r'servers', views.ServerViewSet, basename='server')

# 嵌套路由
# server_router = NestedDefaultRouter(router, r'servers', lookup='server')
# server_router.register(r'comments', views.CommentViewSet, basename='server-comments')

# 评论回复路由
# comment_router = NestedDefaultRouter(server_router, r'comments', lookup='comment')
# comment_router.register(r'replies', views.ReplyViewSet, basename='comment-replies')

urlpatterns = [
    path('', include(router.urls)),
    # path('', include(server_router.urls)),
    # path('', include(comment_router.urls)),
] 